package com.fr.report.script.function;

import com.fr.report.script.Function;
import com.fr.report.script.Function.Type;
import com.fr.report.script.NormalFunction;
import com.fr.report.script.Primitive;

public class REVERSE extends NormalFunction
{
  public Object run(Object[] paramArrayOfObject)
  {
    if (paramArrayOfObject.length != 1)
      return Primitive.ERROR_VALUE;
    Object localObject1 = Primitive.ERROR_VALUE;
    Object localObject2 = paramArrayOfObject[0];
    if (localObject2 instanceof Boolean)
    {
      Boolean localBoolean = (Boolean)localObject2;
      if (localBoolean.equals(Boolean.FALSE))
        localObject1 = Boolean.TRUE;
      else
        localObject1 = Boolean.FALSE;
    }
    return localObject1;
  }

  public Function.Type getType()
  {
    return Function.LOGIC;
  }

  public String getCN()
  {
    return "REVERSE(value):返回与value相反的逻辑值。\n示例：\nREVERSE(true)等于false。";
  }

  public String getEN()
  {
    return "";
  }
}